﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _05_泛型方法
{
    //非泛型类
    public class Person:ISpeaking
    {
        public void Speaking<TPerson>(TPerson t)
            where TPerson:ISpeaking
        {
            Console.WriteLine(t.Name);
        }
       
        public string Name { get; set; }
    }
    public class Teacher:ISpeaking
    {
        public string Name { get; set; }
        public Teacher(string name)
        {
            this.Name = name;
        }
    }
    public class Student:ISpeaking
    {
        public string Name { get; set; }
        public Student(string name)
        {
            this.Name = name;
        }
    }

}
